/* eslint-disable import/no-anonymous-default-export */
import {add, list, status,upd} from '../services/payControlApi';


export default {
    state: {
        data: [],
    },
    effects: {
        async list(params) {
            const response = await list(params)
            if (response.code === 200) {
                this.saveData({
                    data: response.data,

                })
            }
            return response.data
        },
        async add(params) {
            await add(params)
        },
        async status(params) {
            await status(params)
        },async upd(params) {
            await upd(params)
        },

    },
    reducers: {
        saveData(state, paylode) {
            return {
                ...state,
                ...paylode,

            }
        },
    }
}